package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.model.BasicsBody;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ShopLicenceInfoMapper;
import com.ruoyi.system.domain.ShopLicenceInfo;
import com.ruoyi.system.service.IShopLicenceInfoService;

/**
 * 营业执照信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-03
 */
@Service
public class ShopLicenceInfoServiceImpl implements IShopLicenceInfoService 
{
    @Autowired
    private ShopLicenceInfoMapper shopLicenceInfoMapper;

    /**
     * 查询营业执照信息
     * 
     * @param licenceId 营业执照信息主键
     * @return 营业执照信息
     */
    @Override
    public ShopLicenceInfo selectShopLicenceInfoByLicenceId(Long licenceId)
    {
        return shopLicenceInfoMapper.selectShopLicenceInfoByLicenceId(licenceId);
    }

    /**
     * 查询营业执照信息列表
     * 
     * @param shopLicenceInfo 营业执照信息
     * @return 营业执照信息
     */
    @Override
    public List<ShopLicenceInfo> selectShopLicenceInfoList(ShopLicenceInfo shopLicenceInfo)
    {
        return shopLicenceInfoMapper.selectShopLicenceInfoList(shopLicenceInfo);
    }

    /**
     * 新增营业执照信息
     * 
     * @param shopLicenceInfo 营业执照信息
     * @return 结果
     */
    @Override
    public int insertShopLicenceInfo(ShopLicenceInfo shopLicenceInfo)
    {
        shopLicenceInfo.setCreateTime(DateUtils.getNowDate());
        return shopLicenceInfoMapper.insertShopLicenceInfo(shopLicenceInfo);
    }

    /**
     * 修改营业执照信息
     * 
     * @param shopLicenceInfo 营业执照信息
     * @return 结果
     */
    @Override
    public int updateShopLicenceInfo(ShopLicenceInfo shopLicenceInfo)
    {
        shopLicenceInfo.setUpdateTime(DateUtils.getNowDate());
        return shopLicenceInfoMapper.updateShopLicenceInfo(shopLicenceInfo);
    }

    /**
     * 批量删除营业执照信息
     * 
     * @param licenceIds 需要删除的营业执照信息主键
     * @return 结果
     */
    @Override
    public int deleteShopLicenceInfoByLicenceIds(Long[] licenceIds)
    {
        return shopLicenceInfoMapper.deleteShopLicenceInfoByLicenceIds(licenceIds);
    }

    /**
     * 删除营业执照信息信息
     * 
     * @param licenceId 营业执照信息主键
     * @return 结果
     */
    @Override
    public int deleteShopLicenceInfoByLicenceId(Long licenceId)
    {
        return shopLicenceInfoMapper.deleteShopLicenceInfoByLicenceId(licenceId);
    }

    @Override
    public int updateCompanyAndUserInfo(BasicsBody basicsBody) {
        return shopLicenceInfoMapper.updateCompanyAndUserInfo(basicsBody);
    }
}
